<template>
  <view class="unveil-box">
    <nveilingCard
      v-for="(item, inedx) in nveilingInf"
      :key="inedx"
      :title="item.title"
      :unveilingText="item.unveilingText"
      :unveilingAddress="item.unveilingAddress"
      :enterpriceUrl="item.enterpriceUrl"
      :enterpriceTitle="item.enterpriceTitle"
      :describeList="item.describeList"
      :showFlag="item.showFlag"
      @getDetailData="getDetail"
      :interestFlag="interestFlag"
    ></nveilingCard>
	  <none-data v-if="nveilingInf.length===0 && isLoading"/>
  </view>
</template>
<script setup>
import nveilingCard from "@/package_mutual_assistance/pages/mutual-assistance/componts/nveiling-card.vue";
import { onMounted, ref } from "vue";
import { getUserXhbTotalJbLogs } from "@/api/user/index.js";

const interestFlag = ref(true);
const nveilingInf = ref([]);
const isLoading = ref(false)

function getDetail(data) {
  console.log(data, "data");
  uni.navigateTo({
    url: "/package_mutual_assistance/pages/mutual-assistance/detail",
  });
}
onMounted(() => {
  getUserXhbTotalJbLogs({
    size: 5,
    page: 1,
  }).then((res) => {
    console.log(res);
    isLoading.value = true
    res.data.records.map((o) => {
      nveilingInf.value.push({
        showFlag: o.requestType,
        enterpriceUrl: o.avatar,
        unveilingText: o.description,
        title: o.title,
        unveilingAddress: o.location,
        enterpriceTitle: o.xhbPublishPersonInfoVoList? o.xhbPublishPersonInfoVoList[0].publishName:"",
        describeList:o.xhbPublishPersonInfoVoList? o.xhbPublishPersonInfoVoList.map((item) => {
          return item.honorName;
        }):[],
      });
    });
	console.log(nveilingInf.value);
  });
});
</script>
<style scoped lang="less">
.unveil-box {
  padding-left: 40rpx;
  background-color: #ffffff;
}
</style>
